import Vue from 'vue'
import Router from 'vue-router'
import Login from "../components/Login";
import Main from "../components/Main";

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            redirect:'/login'
        },
        {
            path: '/login',
            name: 'login',
            component: Login,
            meta:{
                title:'登录'
            }
        },
        {
            path: '/main',
            name: 'main',
            component: Main,
            children:[
                {
                    path: 'index',
                    name: 'index',
                    component:()=>import('../components/Index'),
                    children:[
                        {
                            path: 'yyy',
                            name: 'yyy',
                            meta:{
                                title:'主界面'
                            }
                        }
                    ]
                },
                {
                    path: '/traveller',
                    name: 'traveller',
                    meta:{
                        title:'用户列表'
                    },
                    component:()=>import('../components/Traveller')
                },
                {
                    path: '/manager',
                    name: 'manager',
                    meta:{
                        title:'管理员列表'
                    },
                    component:()=>import('../components/Manager')
                },
                {
                    path: '/product',
                    name: 'product',
                    meta:{
                        title:'商品信息列表'
                    },
                    component:()=>import('../components/Product')
                },
                {
                    path: '/order',
                    name: 'order',
                    meta:{
                        title:'订单列表'
                    },
                    component:()=>import('../components/Order')
                },
                {
                    path: '/activity',
                    name: 'activity',
                    meta:{
                        title:'活动列表'
                    },
                    component:()=>import('../components/Activity')
                },
                {
                    path: '/activityContent',
                    name: 'activityContent',
                    meta:{
                        title:'活动详情列表'
                    },
                    component:()=>import('../components/ActivityContent')
                },
            ]

        }
    ],
    mode:'history'
})
